home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / gfx / show / MPEGIntuition.lha / MPEGIntuition.e < prev    next >
Text File  |  1980-07-15  |  46KB  |  1,231 lines

  1. /******************(E)(D)evelopment(S)ystem***************
  2. ** FileName:   mpegplayer_3.e
  3. ** Author:     Mahdi/Sauron
  4. ** Company:    GUILT
  5. ** Date:       07-13-96     Time:   22:24:20
  6. ** $VER:       2.5
  7. ***************************************©Sauron***********/
  8. /*********[Revision History]****[Last Update: 07-13-96]**/
  9. /*
  10. ** Version:   2.5
  11. ** Comment:   N/A
  12. **
  13. **     THAT IS TEST VERSION OF v2.5 !!!!!
  14. **
  15. **
  16. **   This Amiga E source is only an example of E programing.
  17. **   You can use part of it in your own programe (Place me on your thx.
  18. **   list :) but you CAN'T create any other Intuition by changing names
  19. **   only !!!!
  20. **
  21. **
  22. **
  23. */
  24.  
  25. OPT OSVERSION=37
  26.  
  27. MODULE 'gadtools', 'libraries/gadtools', 'intuition/intuition','intuition/gadgetclass',
  28.        'intuition/screens','wb',
  29.        'graphics/text','ReqTools',
  30.        'exec/types','exec/ports','exec/memory','dos/dos','devices/inputevent',
  31.        'libraries/ReqTools','exec/lists', 'exec/nodes', 'utility/tagitem',
  32.        'workbench/startup','workbench/workbench','icon'
  33.  
  34. /*-- Function return values. --*/
  35. ENUM NONE,NOCONTEXT, NOGADGET, NOWB, NOVISUAL, OPENGT, NOWINDOW,NO_MP,
  36.      NO_ICONLIB,NO_GADTOOLS,NO_REQTOOLS,NO_ICON
  37.  
  38. /*-- Gadget IDs. --*/
  39. ENUM DELETEBUTTON_ID, STRING_ID, LISTVIEW_ID,
  40.      INFOBUTTON_ID, PLAYBUTTON_ID ,LOADBUTTON_ID, LOADBUTTON2_ID
  41.  
  42. RAISE "MEM" IF New()=NIL,
  43.       "MEM" IF String()=NIL
  44.  
  45. CONST FILEREQ=0
  46.  
  47. DEF id_xsize[3]:     STRING,
  48.     id_ysize[3]:     STRING,
  49.     id_time[13]:     STRING,
  50.     id_framess[9]:   STRING,
  51.     id_framesb[9]:   STRING,
  52.     id_compress[7]:  STRING,
  53.     id_kb[4]:        STRING,
  54.     id_frames[4]:    STRING
  55.  
  56. /*-- Standard SrcGen stuff. --*/
  57. DEF win=NIL:PTR TO window,dither[20]:STRING,
  58.     scr=NIL:PTR TO screen,prr,x,y,levelid,
  59.     glist=NIL,dir[100]:STRING,dirs[100]:STRING,buf[50]:STRING,
  60.     visual=NIL,count,gattext[100]:STRING,
  61.     gatsampl[100]:STRING,
  62.     infos:PTR TO gadget,prio,phii,
  63.     messageClass,rodzajDit,plik[100]:STRING,class,
  64.     offx, offy, tattr:PTR TO textattr ,mainfile[200]:STRING,mppath[100]:STRING,
  65.     smpath[100]:STRING,smform[100]:STRING,
  66.     appath[100]:STRING,noap=FALSE,shit=FALSE,wsize,poOOOOmitazmienna,
  67.     robot[200]:STRING,req:PTR TO rtfilerequester,f
  68.  
  69. /*-- Listview and supporting gadgets. --*/
  70. DEF list=NIL:PTR TO mlh,            /* Exec list holds listview items         */
  71.     listView=NIL:PTR TO gadget,     /* Listview gadget                        */
  72.     infoButton=NIL:PTR TO gadget,
  73.     loadButton=NIL:PTR TO gadget,
  74.     loadSButton=NIL:PTR TO gadget,
  75.     playButton=NIL:PTR TO gadget,
  76.     deleteButton=NIL:PTR TO gadget,
  77.     textX=NIL:PTR TO gadget,
  78.     textY=NIL:PTR TO gadget,
  79.     textSize=NIL:PTR TO gadget,
  80.     textKB=NIL:PTR TO gadget,
  81.     textComp=NIL:PTR TO gadget,
  82.     textFrames=NIL:PTR TO gadget,
  83.     textTime=NIL:PTR TO gadget,
  84.     textKlata=NIL:PTR TO gadget,
  85.     scrolButton=NIL:PTR TO gadget,
  86.     checkRAM=NIL:PTR TO gadget,
  87.     checkLoop=NIL:PTR TO gadget,
  88.     checkNOP=NIL:PTR TO gadget,
  89.     checkNOB=NIL:PTR TO gadget,
  90.     checkPLAY=NIL:PTR TO gadget,
  91.     saveButton=NIL:PTR TO gadget, /* Button gadget TO delete an item        */
  92.     stringGadget=NIL:PTR TO gadget, /* String gadget, value added to listview */
  93.     stringGadgetValue:PTR TO CHAR,   /* Pointer to string gadget buffer        */   
  94.     stringSampl:PTR TO gadget,
  95.     stringSamplValue:PTR TO CHAR,
  96.     check=FALSE,ch1=TRUE,ch2=TRUE,ch3=TRUE,ch4=TRUE,chs=TRUE,
  97.     lue,player=1,font
  98.  
  99. PROC initList(l:PTR TO mlh)
  100. /*-- Initialize an exec list. --*/
  101.   l.head:=l+4
  102.   l.tail:=NIL
  103.   l.tailpred:=l
  104. ENDPROC
  105.  
  106. CHAR '$VER: MPEGInt. v2.5 by MAHDI/SAURON (c) 1996',0
  107.  
  108. PROC setupScreen()
  109. /*-- Open libraries and get screen info. --*/
  110.   IF (gadtoolsbase:=OpenLibrary('gadtools.library',37))=NIL THEN RETURN OPENGT
  111.   IF (scr:=LockPubScreen('Workbench'))=NIL THEN RETURN NOWB
  112.   IF (visual:=GetVisualInfoA(scr,NIL))=NIL THEN RETURN NOVISUAL
  113.   offy:=scr.wbortop+Int(scr.rastport+58)-10
  114.   IF font=0
  115.     tattr:=['topaz.font',8,0,0]:textattr
  116.   ELSE
  117.     tattr:=NIL
  118.   ENDIF
  119. ENDPROC  NONE
  120.  
  121. PROC closeScreen()
  122. /*-- Free resources, close screen and libraries. --*/
  123.   IF glist THEN FreeGadgets(glist)
  124.   IF visual THEN FreeVisualInfo(visual)
  125.   IF scr THEN UnlockPubScreen(NIL,scr)
  126.   IF gadtoolsbase THEN CloseLibrary(gadtoolsbase)
  127. ENDPROC
  128.  
  129. PROC createGadgets()
  130. /*-- Initialize gadget structures and create 'em. --*/
  131.   DEF g, stringInfo:PTR TO stringinfo , stringInfo2:PTR TO stringinfo
  132.   /*-- Init exec list to hold listview items.  Starts out empty. --*/
  133.   list:=New(SIZEOF mlh)
  134.   initList(list)
  135.   IF (g:=CreateContext({glist}))=NIL THEN RETURN NOCONTEXT
  136.   IF (g:=listView:=CreateGadgetA(LISTVIEW_KIND,g,
  137.     [offx+179,offy+26,130,104,'Dither type',tattr,LISTVIEW_ID,0,visual,0]:newgadget,
  138.     [GTLV_LABELS,list,
  139.      GTLV_SHOWSELECTED,NIL,
  140.      TAG_DONE]))=NIL THEN RETURN NOGADGET
  141.   IF (g:=textX:=CreateGadgetA(TEXT_KIND,g,
  142.     [offx+17,offy+31,32,12,'X',tattr,1,2,visual,0]:newgadget,
  143.     [GTTX_TEXT,'000',
  144.      GTTX_BORDER,1,
  145.      NIL]))=NIL THEN RETURN NOGADGET
  146.   IF (g:=textY:=CreateGadgetA(TEXT_KIND,g,
  147.     [offx+131,offy+31,32,12,'SIZE Y',tattr,2,1,visual,0]:newgadget,
  148.     [GTTX_TEXT,'000',
  149.      GTTX_BORDER,1,
  150.      NIL]))=NIL THEN RETURN NOGADGET
  151.   IF (g:=textTime:=CreateGadgetA(TEXT_KIND,g,
  152.     [offx+59,offy+46,104,12,'Time',tattr,3,1,visual,0]:newgadget,
  153.     [GTTX_TEXT,'00000.000000',
  154.      GTTX_BORDER,1,
  155.      NIL]))=NIL THEN RETURN NOGADGET
  156.   IF (g:=textFrames:=CreateGadgetA(TEXT_KIND,g,
  157.     [offx+83,offy+61,80,12,'Frame/s',tattr,4,1,visual,0]:newgadget,
  158.     [GTTX_TEXT,'00.000000',
  159.      GTTX_BORDER,1,
  160.      NIL]))=NIL THEN RETURN NOGADGET
  161.   IF (g:=textSize:=CreateGadgetA(TEXT_KIND,g,
  162.     [offx+83,offy+77,80,12,'Frame/B',tattr,5,1,visual,0]:newgadget,
  163.     [GTTX_TEXT,'000.00000',
  164.      GTTX_BORDER,1,
  165.      NIL]))=NIL THEN RETURN NOGADGET
  166.   IF (g:=textComp:=CreateGadgetA(TEXT_KIND,g,
  167.     [offx+98,offy+92,65,12,'Compress.',tattr,6,1,visual,0]:newgadget,
  168.     [GTTX_TEXT,'00:00.0',
  169.      GTTX_BORDER,1,
  170.      NIL]))=NIL THEN RETURN NOGADGET
  171.   IF (g:=textKB:=CreateGadgetA(TEXT_KIND,g,
  172.     [offx+42,offy+108,41,12,'KB',tattr,7,1,visual,0]:newgadget,
  173.     [GTTX_TEXT,'000000000',
  174.      GTTX_BORDER,1,
  175.      NIL]))=NIL THEN RETURN NOGADGET
  176.   IF (g:=textKlata:=CreateGadgetA(TEXT_KIND,g,
  177.     [offx+122,offy+108,41,12,'Fr.',tattr,7,1,visual,0]:newgadget,
  178.     [GTTX_TEXT,'0000',
  179.      GTTX_BORDER,1,
  180.      NIL]))=NIL THEN RETURN NOGADGET
  181.   IF ch1=0
  182.    IF (g:=checkRAM:=CreateGadgetA(CHECKBOX_KIND,g,
  183.      [offx+134,offy+132,26,11,'RAM',tattr,8,1,visual,0]:newgadget,
  184.      [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
  185.   ELSE
  186.    IF (g:=checkRAM:=CreateGadgetA(CHECKBOX_KIND,g,
  187.      [offx+134,offy+132,26,11,'RAM',tattr,8,1,visual,0]:newgadget,
  188.      [NIL]))=NIL THEN RETURN NOGADGET
  189.   ENDIF
  190.   IF ch4=0
  191.    IF (g:=checkNOP:=CreateGadgetA(CHECKBOX_KIND,g,
  192.      [offx+167,offy+132,26,11,'NOP',tattr,9,2,visual,0]:newgadget,
  193.      [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
  194.   ELSE
  195.    IF (g:=checkNOP:=CreateGadgetA(CHECKBOX_KIND,g,
  196.      [offx+167,offy+132,26,11,'NOP',tattr,9,2,visual,0]:newgadget,
  197.      [NIL]))=NIL THEN RETURN NOGADGET
  198.   ENDIF
  199.   IF ch2=0
  200.    IF (g:=checkLoop:=CreateGadgetA(CHECKBOX_KIND,g,
  201.      [offx+134,offy+147,26,11,'LOOP',tattr,10,1,visual,0]:newgadget,
  202.      [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
  203.   ELSE
  204.    IF (g:=checkLoop:=CreateGadgetA(CHECKBOX_KIND,g,
  205.      [offx+134,offy+147,26,11,'LOOP',tattr,10,1,visual,0]:newgadget,
  206.      [NIL]))=NIL THEN RETURN NOGADGET
  207.   ENDIF
  208.   IF ch3=0
  209.    IF (g:=checkNOB:=CreateGadgetA(CHECKBOX_KIND,g,
  210.      [offx+167,offy+147,26,11,'NOB',tattr,11,2,visual,0]:newgadget,
  211.      [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
  212.   ELSE
  213.    IF (g:=checkNOB:=CreateGadgetA(CHECKBOX_KIND,g,
  214.      [offx+167,offy+147,26,11,'NOB',tattr,11,2,visual,0]:newgadget,
  215.      [NIL]))=NIL THEN RETURN NOGADGET
  216.   ENDIF
  217.   IF (g:=loadButton:=CreateGadgetA(BUTTON_KIND,g,
  218.     [offx+11,offy+179,24,12,'L',tattr,12,0,visual,0]:newgadget,
  219.     [NIL]))=NIL THEN RETURN NOGADGET
  220.   IF (g:=deleteButton:=CreateGadgetA(BUTTON_KIND,g,
  221.     [offx+280,offy+179,26,12,'D',tattr,12,0,visual,0]:newgadget,
  222.     [NIL]))=NIL THEN RETURN NOGADGET
  223.   IF (g:=stringGadget:=CreateGadgetA(STRING_KIND,g,
  224.     [offx+35,offy+179,245,12,'Files',tattr,13,4,visual,0]:newgadget,
  225.     [GTST_STRING,gattext,
  226.      GTST_MAXCHARS,256,
  227.      NIL]))=NIL THEN RETURN NOGADGET
  228.      stringInfo:=stringGadget.specialinfo
  229.      stringGadgetValue:=stringInfo.buffer
  230.  
  231.   IF (g:=loadSButton:=CreateGadgetA(BUTTON_KIND,g,
  232.     [offx+11,offy+194,24,12,'L',tattr,12,0,visual,0]:newgadget,
  233.     [NIL]))=NIL THEN RETURN NOGADGET
  234.   IF (g:=checkPLAY:=CreateGadgetA(CHECKBOX_KIND,g,
  235.      [offx+280,offy+194,22,12,NIL,tattr,10,1,visual,0]:newgadget,
  236.      [NIL]))=NIL THEN RETURN NOGADGET
  237.  
  238.   IF (g:=stringSampl:=CreateGadgetA(STRING_KIND,g,
  239.     [offx+35,offy+194,245,12,NIL,tattr,0,8,visual,0]:newgadget,
  240.     [GTST_STRING,gatsampl,
  241.      GTST_MAXCHARS,256,
  242.      NIL]))=NIL THEN RETURN NOGADGET
  243.      stringInfo2:=stringSampl.specialinfo
  244.      stringSamplValue:=stringInfo2.buffer
  245.  
  246.   IF (g:=playButton:=CreateGadgetA(BUTTON_KIND,g,
  247.     [offx+15,offy+131,66,29,'PLAY',tattr,14,16,visual,0]:newgadget,
  248.     [NIL]))=NIL THEN RETURN NOGADGET
  249.   IF (g:=infoButton:=CreateGadgetA(BUTTON_KIND,g,
  250.     [offx+244,offy+131,58,14,'About',tattr,15,16,visual,0]:newgadget,
  251.     [NIL]))=NIL THEN RETURN NOGADGET
  252.   IF (g:=saveButton:=CreateGadgetA(BUTTON_KIND,g,
  253.     [offx+244,offy+147,58,13,'SAVE',tattr,16,16,visual,0]:newgadget,
  254.     [NIL]))=NIL THEN RETURN NOGADGET
  255.  
  256.   IF (g:=scrolButton:=CreateGadgetA(SCROLLER_KIND,g,
  257.     [offx+13,offy+210,238,10,NIL,tattr,0,1,visual,0]:newgadget,
  258.     [GA_RELVERIFY,1,
  259.      GA_IMMEDIATE,1,
  260.      GTSC_TOTAL,52,
  261.      GTSC_ARROWS,16,
  262.      NIL]))=NIL THEN RETURN NOGADGET
  263.  
  264. ENDPROC  NONE
  265.  
  266. PROC openWindow()
  267.   IF createGadgets()<>NONE THEN RETURN NOGADGET
  268.   /*-- Note WA_IDCMP to get messages from the listview gadget: --*/
  269.   IF (win:=OpenWindowTagList(NIL,
  270.     [WA_LEFT,         x,
  271.      WA_TOP,          y,
  272.      WA_WIDTH,        offx+316,
  273.      WA_HEIGHT,       offy+229,
  274.      WA_MINWIDTH, 316, WA_MINHEIGHT,  11,
  275.      WA_IDCMP,        (IDCMP_REFRESHWINDOW OR IDCMP_CLOSEWINDOW OR IDCMP_GADGETUP OR
  276.                        IDCMP_MOUSEMOVE OR LISTVIEWIDCMP OR SCROLLERIDCMP OR
  277.                        IDCMP_NEWSIZE),
  278.      WA_FLAGS,        (WFLG_DRAGBAR OR WFLG_DEPTHGADGET OR WFLG_CLOSEGADGET OR
  279.                        WFLG_SMART_REFRESH OR WFLG_ACTIVATE OR WFLG_HASZOOM OR
  280.                        WFLG_RMBTRAP),
  281.      WA_TITLE,'MPEG Intuition V2.5',
  282.      WA_SCREENTITLE,'MPEGIntuition v2.5 by Mahdi/Sauron',
  283.      WA_CUSTOMSCREEN, scr,
  284.      WA_AUTOADJUST,   1,
  285.      WA_GADGETS,      glist,
  286.      TAG_DONE]))=NIL THEN RETURN NOWINDOW
  287.   PrintIText(win.rport,
  288.     [1,0,0,50,14,tattr,'MPEG Info',NIL]:intuitext,offx,offy)
  289.   DrawBevelBoxA(win.rport,7+offx,165+offy,302,60,
  290.     [GT_VISUALINFO,visual,NIL])
  291.   DrawBevelBoxA(win.rport,7+offx,127+offy,302,37,
  292.     [GT_VISUALINFO,visual,NIL])
  293.   DrawBevelBoxA(win.rport,7+offx,26+offy,170,100,
  294.     [GT_VISUALINFO,visual,NIL])
  295.   Gt_RefreshWindow(win, NIL)
  296.    SetStdRast(win.rport)
  297.    Colour(1,0)
  298.    TextF(offx+251,offy+217,' 0.0 s')
  299. ENDPROC NONE
  300.  
  301. PROC closeWindow()
  302.   IF win THEN CloseWindow(win)
  303. ENDPROC
  304.  
  305. PROC wait4message(win:PTR TO window)
  306.   DEF mes:PTR TO intuimessage,type
  307.   REPEAT
  308.     type:=0
  309.     IF mes:=Gt_GetIMsg(win.userport)
  310.       type:=mes.class
  311.       SELECT type
  312.         CASE IDCMP_NEWSIZE
  313. /*          IF wsize=1
  314.               ->wsize:=0
  315.  
  316.           ELSEIF wsize=0
  317.                wsize:=1
  318.           ENDIF*/
  319.         CASE IDCMP_GADGETUP
  320.           /*-- Any old gadget will do.  The address is used --*/
  321.           /*-- to identify which one sent the message.      --*/
  322.           infos:=mes.iaddress
  323.           infos.gadgetid:=mes.code
  324.         SELECT infos
  325.          CASE listView
  326.            rodzajDit:=mes.code
  327.          ENDSELECT
  328.           IF mes.code THEN check:=TRUE ELSE check:=FALSE
  329.          CASE IDCMP_REFRESHWINDOW
  330.           name()
  331.           IF wsize=1
  332.              IF poOOOOmitazmienna=1
  333. /*
  334. **               wpis()
  335. */
  336.                 Gt_SetGadgetAttrsA (textTime, win, NIL,
  337.                             [GTTX_TEXT,id_time,GTTX_BORDER,1,NIL])
  338.                 Gt_SetGadgetAttrsA (textX, win, NIL,
  339.                             [GTTX_TEXT,id_xsize,GTTX_BORDER,1,NIL])
  340.                 Gt_SetGadgetAttrsA (textY, win, NIL,
  341.                             [GTTX_TEXT,id_ysize,GTTX_BORDER,1,NIL])
  342.                 Gt_SetGadgetAttrsA (textSize, win, NIL,
  343.                             [GTTX_TEXT,id_framesb,GTTX_BORDER,1,NIL])
  344.                 Gt_SetGadgetAttrsA (textFrames, win, NIL,
  345.                             [GTTX_TEXT,id_framess,GTTX_BORDER,1,NIL])
  346.                 Gt_SetGadgetAttrsA (textComp, win, NIL,
  347.                             [GTTX_TEXT,id_compress,GTTX_BORDER,1,NIL])
  348.                 Gt_SetGadgetAttrsA (textKB,win ,NIL,
  349.                             [GTTX_TEXT,id_kb,GTTX_BORDER,1,NIL])
  350.                 Gt_SetGadgetAttrsA (textKlata,win ,NIL,
  351.                             [GTTX_TEXT,id_frames,GTTX_BORDER,1,NIL])
  352.  
  353.                Gt_SetGadgetAttrsA (listView, win, NIL,
  354.                       [GTLV_LABELS, list,
  355.                        GTLV_TOP,    0,
  356.                        TAG_DONE])
  357.              ELSE
  358.               Gt_BeginRefresh(win)
  359.               Gt_EndRefresh(win,TRUE)
  360.              ENDIF
  361.                 PrintIText(win.rport,
  362.                 [1,0,0,50,14,tattr,'MPEG Info',NIL]:intuitext,offx,offy)
  363.                 DrawBevelBoxA(win.rport,7+offx,165+offy,302,60,
  364.                 [GT_VISUALINFO,visual,NIL])
  365.                 DrawBevelBoxA(win.rport,7+offx,127+offy,302,37,
  366.                 [GT_VISUALINFO,visual,NIL])
  367.                 DrawBevelBoxA(win.rport,7+offx,26+offy,170,100,
  368.                 [GT_VISUALINFO,visual,NIL])
  369.                 scrol()
  370.             wsize:=0
  371.           ELSEIF wsize=0
  372.               wsize:=1
  373.           ENDIF
  374.           type:=0
  375.       ENDSELECT
  376.       Gt_ReplyIMsg(mes)
  377.     ELSE
  378.       WaitPort(win.userport)
  379.     ENDIF
  380.   UNTIL type
  381. ENDPROC type
  382.  
  383. PROC addToList()
  384.   DEF newNode=NIL:PTR TO ln, node:PTR TO ln,
  385.       len, itemPosition=0
  386.   newNode:=New(SIZEOF ln)
  387.   len:=StrLen(lue)
  388.   newNode.name:=String(len)
  389.   StrCopy(newNode.name, lue, ALL)
  390. /*-- Detach the exec LIST from the listview gadget. --*/
  391.   Gt_SetGadgetAttrsA (listView, win, NIL, [GTLV_LABELS, -1, TAG_DONE])
  392. /*-- Decide where TO insert the new item.  Sorted on first character. --*/
  393.   node:=list.head
  394.   Insert(list, newNode, node.pred)
  395. /*  ENDIF*/
  396.   /*-- Reattach the exec list to the listview gadget. --*/
  397.   Gt_SetGadgetAttrsA (listView, win, NIL,
  398.                       [GTLV_LABELS, list,
  399.                        GTLV_TOP,    itemPosition,
  400.                        TAG_DONE])
  401. ENDPROC
  402.  
  403. PROC main() HANDLE
  404. DEF listItemPosition=0,mp_Task,pentla,brom,prob[2]:STRING
  405.   IF reqtoolsbase:=OpenLibrary('reqtools.library',37)
  406.    font:=1
  407.    ikona()
  408.    levelid:=0
  409.    wsize:=0
  410.    RightStr(prob,mppath,1)
  411.     IF (FileLength(mppath)<=0) OR (StrCmp(prob,':'))
  412.       Raise(NO_MP)
  413.       WriteF('No MP:\d\n', FileLength(mppath))
  414.     ENDIF
  415.     pentla:=1
  416.     poOOOOmitazmienna:=0
  417.    IF setupScreen()=NONE
  418.     IF openWindow()=NONE
  419.      lue:='AMP-cybergfxgray'
  420.      addToList()
  421.      lue:='AMP-cybergfx'
  422.      addToList()
  423.      lue:='AMP-gray'
  424.      addToList()
  425.      lue:='AMP-hiresham'
  426.      addToList()
  427.      lue:='AMP-ham6'
  428.      addToList()
  429.      lue:='AMP-color'
  430.      addToList()
  431.      lue:='Opal15'
  432.      addToList()
  433.      lue:='Opal24'
  434.      addToList()
  435.      lue:='Village24'
  436.      addToList()
  437.      lue:='EGS24'
  438.      addToList()
  439.      lue:='Retina24'
  440.      addToList()
  441.      lue:='Mono'
  442.      addToList()
  443.      lue:='FS4'
  444.      addToList()
  445.      lue:='FS2 Fast'
  446.      addToList()
  447.      lue:='FS2'
  448.      addToList()
  449.      lue:='Ordered2'
  450.      addToList()
  451.      lue:='Ordered'
  452.      addToList()
  453.      lue:='Hybrid2'
  454.      addToList()
  455.      lue:='Hybrid'
  456.      addToList()
  457.      lue:='Threshold'
  458.      addToList()
  459.      lue:='MBordered'
  460.      addToList()
  461.      lue:='2x2'
  462.      addToList()
  463.      lue:='Color'
  464.      addToList()
  465.      lue:='HAM6'
  466.      addToList()
  467.      lue:='HAM8'
  468.      addToList()
  469.      lue:='Gray'
  470.      addToList()
  471.      lue:='Gray8'
  472.      addToList()
  473.      rodzajDit:=prr
  474. ->    inform()
  475.       REPEAT
  476.         messageClass:=wait4message(win)
  477.         SELECT messageClass
  478.           CASE IDCMP_GADGETUP
  479.             SELECT infos  /* pointer to gadget */
  480.               CASE scrolButton
  481.                 levelid:=infos.gadgetid
  482.                 scrol()
  483.               CASE infoButton
  484.                inform()
  485.                ->play()
  486.               CASE saveButton
  487.                IF req:=RtAllocRequestA(FILEREQ,0)
  488.                 phii:=RtLockWindow(win)
  489.                    RtEZRequestA('Prg. MP needs(?!?!?!??) path < 31 chars.',
  490.                    'BI-LA KAIFA !!!!',0,0,0)
  491.                    RtChangeReqAttrA(req,[RTFI_DIR,dir])
  492.                     IF RtFileRequestA(req,NIL,'Pick a drawer TO save !!!'
  493.                       ,[RTFI_FLAGS,(FREQF_NOFILES OR FREQF_SAVE)])
  494.                       StrCopy(robot,req.dir)
  495.                       StrCopy(plik,robot)
  496.                       StringF(robot,'IFF24.%%%%')
  497.                       IF RtGetStringA(robot,100,'Enter a file pattern !!!',0,0)
  498.                     StrCopy(mainfile,req.dir,ALL)
  499.                     IF StrCmp(req.dir[StrLen(mainfile)-1],':')
  500.                      StrCopy(plik,mainfile)
  501.                     ELSEIF StrCmp(req.dir[StrLen(mainfile)-1],'/')
  502.                      StrCopy(plik,mainfile)
  503.                     ELSEIF StrLen(mainfile)<1
  504.                      StrCopy(plik,mainfile)
  505.                     ELSE
  506.                      StrCopy(plik,mainfile)
  507.                      StrAdd(plik,'/')
  508.                     ENDIF
  509.                          StrCopy(mainfile,plik,ALL)
  510.                          StringF(plik,'"\s\s"',mainfile,robot)
  511.                            IF StrLen(plik)>31
  512.                              RtEZRequestA('It must be under 31 chars !!!!.',
  513.                              'Doup !!! Sorry I''ll try again !!',0,0,0)
  514.                            ELSE
  515.                          StringF(robot,'\s -saveiff \s "\s"',mppath,plik,gattext)
  516.                          Execute(robot,NIL,0)
  517.                          robot[]:=0
  518.                       ENDIF
  519.                     ENDIF
  520.                  ENDIF
  521.                  RtUnlockWindow(win,phii)
  522.                  RtFreeRequest(req)
  523.                ENDIF
  524.         CASE playButton
  525.             IF (noap=1) AND (rodzajDit>20)
  526.                shit:=1
  527.             ENDIF
  528.              IF shit=0
  529.               IF mp_Task:=Open('ram:pracfile',NEWFILE)
  530.                IF FileLength(stringGadgetValue)<>0
  531. /*
  532. ** Button OFF
  533. */
  534.            Gt_SetGadgetAttrsA (loadButton, win, NIL,
  535.                       [GA_DISABLED,1,TAG_DONE])
  536.            Gt_SetGadgetAttrsA (deleteButton, win, NIL,
  537.                       [GA_DISABLED,1,TAG_DONE])
  538.            Gt_SetGadgetAttrsA (playButton, win, NIL,
  539.                       [GA_DISABLED,1,TAG_DONE])
  540.            Gt_SetGadgetAttrsA (saveButton, win, NIL,
  541.                       [GA_DISABLED,1,TAG_DONE])
  542.            Gt_SetGadgetAttrsA (infoButton, win, NIL,
  543.                       [GA_DISABLED,1,TAG_DONE])
  544.            Gt_SetGadgetAttrsA (loadSButton, win, NIL,
  545.                       [GA_DISABLED,1,TAG_DONE])
  546.            Gt_SetGadgetAttrsA (checkPLAY, win, NIL,
  547.                       [GA_DISABLED,1,TAG_DONE])
  548.  
  549.                 IF rodzajDit=0 THEN StrCopy(dither,'dither gray8 ',ALL)
  550.                 IF rodzajDit=1 THEN StrCopy(dither,'dither gray ',ALL)
  551.                 IF rodzajDit=2 THEN StrCopy(dither,'dither ham8 ',ALL)
  552.                 IF rodzajDit=3 THEN StrCopy(dither,'dither ham6 ',ALL)
  553.                 IF rodzajDit=4 THEN StrCopy(dither,'dither color ',ALL)
  554.                 IF rodzajDit=5 THEN StrCopy(dither,'dither 2x2 ',ALL)
  555.                 IF rodzajDit=6 THEN StrCopy(dither,'dither mbordered ',ALL)
  556.                 IF rodzajDit=7 THEN StrCopy(dither,'dither threshold ',ALL)
  557.                 IF rodzajDit=8 THEN StrCopy(dither,'dither hybrid ',ALL)
  558.                 IF rodzajDit=9 THEN StrCopy(dither,'dither hybrid2 ',ALL)
  559.                 IF rodzajDit=10 THEN StrCopy(dither,'dither ordered ',ALL)
  560.                 IF rodzajDit=11 THEN StrCopy(dither,'dither ordered2 ',ALL)
  561.                 IF rodzajDit=12 THEN StrCopy(dither,'dither fs2 ',ALL)
  562.                 IF rodzajDit=13 THEN StrCopy(dither,'dither fs2fast ',ALL)
  563.                 IF rodzajDit=14 THEN StrCopy(dither,'dither fs4 ',ALL)
  564.                 IF rodzajDit=15 THEN StrCopy(dither,'dither mono ',ALL)
  565.                 IF rodzajDit=16 THEN StrCopy(dither,'dither retina24 ',ALL)
  566.                 IF rodzajDit=17 THEN StrCopy(dither,'dither egs24 ',ALL)
  567.                 IF rodzajDit=18 THEN StrCopy(dither,'dither village24 ',ALL)
  568.                 IF rodzajDit=19 THEN StrCopy(dither,'dither opal24 ',ALL)
  569.                 IF rodzajDit=20 THEN StrCopy(dither,'dither opal15 ',ALL)
  570.                 IF rodzajDit=21 THEN StrCopy(dither,'dither color ',ALL)
  571.                 IF rodzajDit=22 THEN StrCopy(dither,'dither ham6 ',ALL)
  572.                 IF rodzajDit=23 THEN StrCopy(dither,'dither hiresham ',ALL)
  573.                 IF rodzajDit=24 THEN StrCopy(dither,'dither gray ',ALL)
  574.                 IF rodzajDit=25 THEN StrCopy(dither,'dither cybrtgfx ',ALL)
  575.                 IF rodzajDit=26 THEN StrCopy(dither,'dither cybergfxgray ',ALL)
  576.                 StringF(mainfile,'')
  577.                  IF rodzajDit>20
  578.                     StrAdd(mainfile,appath,ALL)
  579.                     player:=2
  580.                  ELSE
  581.                     StrAdd(mainfile,mppath,ALL)
  582.                     player:=1
  583.                  ENDIF
  584.                   IF chs=0 THEN play()
  585.                   IF ch3=0
  586.                       IF(rodzajDit > 20)
  587.                         StrAdd(mainfile,' NOB',ALL)
  588.                       ELSE 
  589.                         StrAdd(mainfile,' -nob',ALL)
  590.                       ENDIF
  591.                   ENDIF
  592.                   IF ch4=0
  593.                       IF(rodzajDit > 20)
  594.                         StrAdd(mainfile,' NOP',ALL)
  595.                       ELSE 
  596.                         StrAdd(mainfile,' -nop',ALL)
  597.                       ENDIF
  598.                   ENDIF
  599.                   IF(rodzajDit > 20)
  600.                      StrAdd(mainfile,' ',ALL)
  601.                      StrAdd(mainfile,dither,ALL)
  602.                   ELSE
  603.                      StrAdd(mainfile,' -',ALL)
  604.                      StrAdd(mainfile,dither,ALL)
  605.                   ENDIF
  606.                   count:=0
  607.                   IF ch2=0
  608.                         pentla:=1
  609.                         IF  RtGetLongA({pentla},'Write LOOP number:',0,0)
  610.                      ELSE
  611.                         pentla:=-1
  612.                      ENDIF
  613.                   ENDIF
  614.                IF pentla>0
  615.                  IF pentla=0 THEN pentla:=1
  616.                   IF ch1=0
  617.                     cop(stringGadgetValue,'ram:mpeg.tmp')
  618.                     StrAdd(mainfile,'RAM:')
  619.                     StrAdd(mainfile,'mpeg.tmp')
  620.                       count:=1
  621.                       REPEAT
  622. ->                        WriteF('Odpalenie1:\s:\n',mainfile)
  623.                         Execute(mainfile,0,mp_Task)
  624.                         count:=count+1
  625.                       UNTIL count>=pentla
  626.                     pentla:=1
  627.                      DeleteFile('ram:mpeg.tmp')
  628.                   ELSE
  629.                     StringF(robot,'"\s"',stringGadgetValue)
  630.                     StrAdd(mainfile,robot,ALL)
  631.                       REPEAT
  632. ->                        WriteF('Odpalenie2:\s:\n',mainfile)
  633.                         Execute(mainfile,0,mp_Task)
  634.                         count:=count+1
  635.                       UNTIL count=pentla
  636.                     pentla:=1
  637.                  ENDIF
  638.               ENDIF
  639.                    IF pentla=-1 THEN pentla:=1
  640. /*
  641. ** Button's OK
  642. */
  643.            poOOOOmitazmienna:=1
  644.            Gt_SetGadgetAttrsA (loadButton, win, NIL,
  645.                       [GA_DISABLED,0,TAG_DONE])
  646.            Gt_SetGadgetAttrsA (deleteButton, win, NIL,
  647.                       [GA_DISABLED,0,TAG_DONE])
  648.            Gt_SetGadgetAttrsA (playButton, win, NIL,
  649.                       [GA_DISABLED,0,TAG_DONE])
  650.            Gt_SetGadgetAttrsA (saveButton, win, NIL,
  651.                       [GA_DISABLED,0,TAG_DONE])
  652.            Gt_SetGadgetAttrsA (infoButton, win, NIL,
  653.                       [GA_DISABLED,0,TAG_DONE])
  654.            Gt_SetGadgetAttrsA (loadSButton, win, NIL,
  655.                       [GA_DISABLED,0,TAG_DONE])
  656.            Gt_SetGadgetAttrsA (checkPLAY, win, NIL,
  657.                       [GA_DISABLED,0,TAG_DONE])
  658.  
  659.              ENDIF
  660.               ENDIF
  661.                  Close(mp_Task)
  662.                  IF (FileLength('RAM:pracfile')>10) AND (FileLength
  663.                      ('RAM:pracfile')<175)
  664.                     wpis()
  665.                  ELSE
  666.                  ENDIF
  667.                 ENDIF
  668. /* ENDIF*/
  669.                shit:=0
  670.               CASE loadSButton
  671.                   loadsmp()
  672.               CASE loadButton
  673.                IF req:=RtAllocRequestA(FILEREQ,0)
  674.                 phii:=RtLockWindow(win)
  675.                  RtChangeReqAttrA(req,[RTFI_DIR,dir,RTFI_MATCHPAT,
  676.                  '#?.(MPEG|MP|MPG)'])
  677.                   IF RtFileRequestA(req,buf,'Pick an mpeg anim !!!'
  678.                    ,[RT_WAITPOINTER,(512),RTFI_FLAGS,(FREQF_PATGAD),
  679.                    RTFI_OKTEXT,('SURE')])
  680.                    StrCopy(plik,buf)
  681.                    StrCopy(dir,req.dir)
  682.                     IF StrCmp(req.dir[StrLen(dir)-1],':')
  683.                      StrCopy(gattext,dir)
  684.                      StrAdd(gattext,plik)
  685.                     ELSEIF StrCmp(req.dir[StrLen(dir)-1],'/')
  686.                      StrCopy(gattext,dir)
  687.                      StrAdd(gattext,plik)
  688.                     ELSEIF StrLen(dir)<1
  689.                      StrCopy(gattext,dir)
  690.                      StrAdd(gattext,plik)
  691.                     ELSE
  692.                      StrCopy(gattext,dir)
  693.                      StrAdd(gattext,'/')
  694.                      StrAdd(gattext,plik)
  695.                     ENDIF
  696.                    Gt_SetGadgetAttrsA (stringGadget, win, NIL,
  697.                    [GTST_STRING,gattext,TAG_DONE])
  698.                    StrCopy(dir,req.dir)
  699.                    RtFreeRequest(req)
  700.                   ENDIF
  701.                  RtUnlockWindow(win,phii)
  702.                ENDIF
  703.               CASE listView
  704.                 listItemPosition:=infos.gadgetid /* note the use of this field! */
  705.               CASE checkRAM
  706.                 ch1:=check+1
  707.               CASE checkLoop
  708.                 ch2:=check+1
  709.               CASE checkNOP
  710.                 ch3:=check+1
  711.               CASE checkNOB
  712.                 ch4:=check+1
  713.               CASE checkPLAY
  714.                 chs:=check+1
  715.               CASE deleteButton
  716.                phii:=RtLockWindow(win)
  717.                brom:=RtEZRequestA('Shall I delete that file ?\n\s',
  718.                'Delete|Nope leave it',0,[stringGadgetValue],0)
  719.                 IF brom=1
  720.                     DeleteFile(stringGadgetValue)
  721.                 ELSE
  722.                 ENDIF
  723.               RtUnlockWindow(win,phii)
  724.            ENDSELECT
  725.           CASE IDCMP_INTUITICKS
  726.             NOP/*  these are being sent FOR some shitty reason }:-( */
  727.         ENDSELECT
  728.       UNTIL messageClass=IDCMP_CLOSEWINDOW
  729.       closeWindow()
  730.        IF FileLength('ram:pracfile')>0
  731.           DeleteFile('ram:pracfile')
  732.        ENDIF
  733.     ENDIF
  734.   ENDIF
  735.   CloseLibrary(reqtoolsbase)
  736.  ELSE
  737.   Raise(NO_REQTOOLS)
  738.  ENDIF
  739.   closeScreen()
  740.   CleanUp(0)
  741. EXCEPT
  742.   SELECT exception
  743.       IF reqtoolsbase THEN CloseLibrary(reqtoolsbase)
  744.       CASE NO_MP
  745.                          EasyRequestArgs(NIL,
  746.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  747.                         '   I can''t find MP program   \n   check path in icon prefs',
  748.                         'OK :(']:easystruct,
  749.                         NIL,NIL)
  750.       CASE NO_ICONLIB
  751.                         EasyRequestArgs(NIL,
  752.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  753.                         '   Sorry no icon.library\nin your''s LIBS: dir',
  754.                         'OK I''ll copy it']:easystruct,
  755.                         NIL,NIL)
  756.       CASE NO_ICON
  757.                         EasyRequestArgs(NIL,
  758.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  759.                         'Sorry, you need TO run\n this program from WB',
  760.                         'OK (I understand)']:easystruct,
  761.                         NIL,NIL)
  762.       CASE NO_REQTOOLS
  763.                         EasyRequestArgs(NIL,
  764.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  765.                         ' Sorry no ReqTools.library\n   in your''s LIBS: dir',
  766.                         'OK I''ll copy it']:easystruct,
  767.                         NIL,NIL)
  768.       DEFAULT
  769.       WriteF('Well there is some error ( >:-< ) blââââdddd np.\n')
  770.       WriteF('Excident nr: "\s"\n', [exception, 0])
  771.       closeWindow()
  772.       closeScreen()
  773.       CleanUp(0)
  774.   ENDSELECT
  775. ENDPROC
  776.  
  777. PROC scrol()
  778.    SetStdRast(win.rport)
  779.    Colour(1,0)
  780.     IF levelid < 10
  781.      StringF(mainfile,' 0.\d s',levelid)
  782.     ELSEIF levelid = 10
  783.      StringF(mainfile,' 1.0 s')
  784.     ELSEIF (levelid < 20) AND (levelid > 10)
  785.      StringF(mainfile,' 1.\d s',levelid-10)
  786.     ELSEIF levelid = 20
  787.      StringF(mainfile,' 2.0 s')
  788.     ELSEIF (levelid < 30) AND (levelid > 20)
  789.      StringF(mainfile,' 2.\d s',levelid-20)
  790.     ELSEIF levelid = 30
  791.      StringF(mainfile,' 3.0 s')
  792.     ELSEIF (levelid < 40) AND (levelid > 30)
  793.      StringF(mainfile,' 3.\d s',levelid-30)
  794.     ELSEIF levelid = 40
  795.      StringF(mainfile,' 4.0 s')
  796.     ELSEIF (levelid < 50) AND (levelid > 40)
  797.      StringF(mainfile,' 4.\d s',levelid-40)
  798.     ELSEIF levelid = 50
  799.      StringF(mainfile,' 5.0 s')
  800.     ENDIF
  801.    TextF(offx+251,offy+217,mainfile)
  802.  
  803. ENDPROC
  804.  
  805. PROC loadsmp()
  806.     DEF dir[100]:STRING
  807.  
  808.   IF req:=RtAllocRequestA(FILEREQ,0)
  809.     phii:=RtLockWindow(win)
  810.     RtChangeReqAttrA(req,[RTFI_DIR,dirs,RTFI_MATCHPAT,
  811.                      '#?.#?'])
  812.        IF RtFileRequestA(req,buf,'Pick a sample file !!!'
  813.               ,[RT_WAITPOINTER,(512),RTFI_FLAGS,(FREQF_PATGAD),
  814.                RTFI_OKTEXT,('SURE')])
  815.                StrCopy(plik,buf)
  816.                StrCopy(dirs,req.dir)
  817.                 IF StrCmp(req.dir[StrLen(dir)-1],':')
  818.                  StrCopy(gatsampl,dirs)
  819.                  StrAdd(gatsampl,plik)
  820.                 ELSEIF StrCmp(req.dir[StrLen(dir)-1],'/')
  821.                   StrCopy(gatsampl,dirs)
  822.                   StrAdd(gatsampl,plik)
  823.                     ELSEIF StrLen(dirs)<1
  824.                      StrCopy(gatsampl,dirs)
  825.                      StrAdd(gatsampl,plik)
  826.                     ELSE
  827.                      StrCopy(gatsampl,dirs)
  828.                      StrAdd(gatsampl,'/')
  829.                      StrAdd(gatsampl,plik)
  830.                     ENDIF
  831.                    Gt_SetGadgetAttrsA (stringSampl, win, NIL,
  832.                    [GTST_STRING,gatsampl,TAG_DONE])
  833.                    StrCopy(dirs,req.dir)
  834.                    RtFreeRequest(req)
  835.                   ENDIF
  836.                  RtUnlockWindow(win,phii)
  837.                ENDIF
  838. ENDPROC
  839.  
  840. PROC name()
  841.   SetWindowTitles(win,'MPEG Intuition V2.5', Not(0))
  842. ENDPROC
  843.  
  844. PROC inform()
  845.  
  846. DEF w=NIL:PTR TO window
  847.     phii:=RtLockWindow(win)
  848.  IF w:=OpenWindowTagList(NIL,[WA_FLAGS,$E,WA_IDCMP,$268,IDCMP_MOUSEBUTTONS,0,
  849.                   WA_TOP,win.topedge+40,WA_LEFT,win.leftedge+8,
  850.                   WA_WIDTH,300,WA_HEIGHT,140,WA_TITLE,'About MPEG intuition V2.5',0])
  851.                   SetStdRast(w.rport)
  852.                   SetTopaz(8)
  853.                   Colour(2,0)
  854.                   TextF(55,30,'  MPEG Intuition v2.5')
  855.                   TextF(52,45,'by Mahdi/Sauron (c) 1996')
  856.                   Colour(1,0)
  857.                   TextF(55,65,'Bugs & Develope send TO:')
  858.                   TextF(45,75,'Adrian (SAURON) Siemieniak')
  859.                   TextF(45,85,'sauron@sco.zsi.pwr.wroc.pl')
  860.                   TextF(35,95,'sauron@sun1000.ci.pwr.wroc.pl')
  861.                   TextF(75,105,'tel.(071) 24-10-20')
  862.                   TextF(10,125,'-----------------------------------')
  863.                   ->WaitLeftMouse(w)
  864.                   REPEAT
  865.                       class:=WaitIMessage(w)
  866.                   UNTIL (class=IDCMP_CLOSEWINDOW) OR (class=8)
  867.                    CloseWindow(w)
  868.                   name()
  869.  ENDIF
  870.     RtUnlockWindow(win,phii)
  871. ENDPROC
  872.  
  873. PROC wpis()
  874.   DEF inputstring[80]:STRING,work[20]:STRING,work2[14]:STRING,mp_Task,x,y,a,b
  875.   IF FileLength('ram:pracfile')>0
  876.    IF mp_Task:=Open('ram:pracfile',OLDFILE)
  877.       ReadStr(mp_Task,inputstring)
  878.       StrCopy(work2,'')
  879.     IF player=1
  880.       ReadStr(mp_Task,inputstring)
  881.       MidStr(work,inputstring,41,StrLen(inputstring)-46)
  882.       FOR a:=0 TO 12-StrLen(work) DO StrAdd(work2,' ')
  883.       x:= RealVal(work)
  884.       StrAdd(work2,work)
  885.       StrCopy(id_time,work2)
  886.       Gt_SetGadgetAttrsA (textTime, win, NIL,
  887.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  888.  
  889.       ReadStr(mp_Task,inputstring)
  890.       a:= InStr(inputstring,' x',10)
  891.       MidStr(work,inputstring,11,a-11)
  892.       StrCopy(id_xsize,work)
  893.       Gt_SetGadgetAttrsA (textX, win, NIL,
  894.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  895.       a:= InStr(inputstring,'x ',10)
  896.       b:= InStr(inputstring,' Pi',10)
  897.       b:= b-2-a
  898.       IF b=2
  899.           a:=a-1
  900.           b:=3
  901.       ENDIF
  902.       MidStr(work,inputstring,a+2,b)
  903.       StrCopy(id_ysize,work)
  904.       Gt_SetGadgetAttrsA (textY, win, NIL,
  905.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  906.  
  907.       ReadStr(mp_Task,inputstring)
  908.       StrCopy(work2,'')
  909.       MidStr(work,inputstring,17,StrLen(inputstring)-6)
  910.       FOR a:=0 TO 8-StrLen(work) DO StrAdd(work2,' ')
  911.       y:= RealVal(work)
  912.       StrAdd(work2,work)
  913.       StrCopy(id_framess,work2)
  914.       Gt_SetGadgetAttrsA (textFrames, win, NIL,
  915.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  916.  
  917.       ReadStr(mp_Task,inputstring)
  918.       UpperStr(inputstring)
  919.       StrCopy(work2,'')
  920.       a:= InStr(inputstring,' BYTES',13)
  921.       MidStr(work,inputstring,16,a-16)
  922.       FOR a:=1 TO 9- StrLen(work) DO StrAdd(work2,' ')
  923.       StrAdd(work2,work)
  924.       StrCopy(id_framesb,work2)
  925.       Gt_SetGadgetAttrsA (textSize, win, NIL,
  926.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  927.       a:= InStr(inputstring,'TE ',42)
  928.       MidStr(work,inputstring,a+2,7)
  929.       StrCopy(id_compress,work)
  930.       Gt_SetGadgetAttrsA (textComp, win, NIL,
  931.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  932.     ELSE
  933.       ReadStr(mp_Task,inputstring)
  934.       MidStr(work,inputstring,41,StrLen(inputstring)-46)
  935.       FOR a:=0 TO 12-StrLen(work) DO StrAdd(work2,' ')
  936.       x:= RealVal(work)
  937.       StrAdd(work2,work)
  938.       StrCopy(id_time,work2)
  939.       Gt_SetGadgetAttrsA (textTime, win, NIL,
  940.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  941.  
  942.       ReadStr(mp_Task,inputstring)
  943.       StrCopy(work2,'')
  944.       MidStr(work,inputstring,17,StrLen(inputstring)-6)
  945.       FOR a:=0 TO 8-StrLen(work) DO StrAdd(work2,' ')
  946.       y:= RealVal(work)
  947.       StrAdd(work2,work)
  948.       StrCopy(id_framess,work2)
  949.       Gt_SetGadgetAttrsA (textFrames, win, NIL,
  950.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  951.  
  952.       ReadStr(mp_Task,inputstring)
  953.       a:= InStr(inputstring,'*',10)
  954.       MidStr(work,inputstring,12,a-12)
  955.       StrCopy(id_xsize,work)
  956.       Gt_SetGadgetAttrsA (textX, win, NIL,
  957.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  958.       a:= InStr(inputstring,'*',10)
  959.       b:= InStr(inputstring,' pi',10)
  960.       b:= b-2-a
  961.       IF b=1
  962.           b:=2
  963.           MidStr(work2,inputstring,a+1,b)
  964.           StringF(work,' \s',work2)
  965.       ELSEIF
  966.           MidStr(work,inputstring,a+1,b+2)
  967.       ENDIF
  968.       StrCopy(id_ysize,work)
  969.       Gt_SetGadgetAttrsA (textY, win, NIL,
  970.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  971.  
  972.       StrCopy(work2,'')
  973.       b:= !x*y
  974.       a:= FileLength(gattext)/(!b!)
  975.       StringF(work,'\d.2',a)
  976.       FOR a:=0 TO 8-StrLen(work) DO StrAdd(work2,' ')
  977.       StrAdd(work2,work)
  978.       StrCopy(id_framesb,work2)
  979.       Gt_SetGadgetAttrsA (textSize, win, NIL,
  980.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  981.  
  982.    ENDIF
  983.  
  984. /* File length procedure*/
  985.       StrCopy(work2,'')
  986.       StringF(work,'\d',FileLength(gattext))
  987.       a:= Val(work)
  988.       b:=Div(a,1024)
  989.       StringF(work,'\d',b)
  990.       FOR a:=0 TO 3-StrLen(work) DO StrAdd(work2,' ')
  991.       StrAdd(work2,work)
  992.       StrCopy(id_kb,work2)
  993.       Gt_SetGadgetAttrsA (textKB,win ,NIL,
  994.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  995.  
  996. /* Frames counter procedure */
  997.       b:=!x*y
  998.       StringF(work,'\d',!b!)
  999.       StrCopy(work2,'')
  1000.       FOR a:=0 TO 3-StrLen(work) DO StrAdd(work2,' ')
  1001.       StrAdd(work2,work)
  1002.       StrCopy(id_frames,work2)
  1003.       Gt_SetGadgetAttrsA (textKlata,win ,NIL,
  1004.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  1005.     Close(mp_Task)
  1006.   ENDIF
  1007.  ELSE
  1008.       Gt_SetGadgetAttrsA (textTime, win, NIL,
  1009.                   [GTTX_TEXT,id_time,GTTX_BORDER,1,NIL])
  1010.       Gt_SetGadgetAttrsA (textX, win, NIL,
  1011.                   [GTTX_TEXT,id_xsize,GTTX_BORDER,1,NIL])
  1012.       Gt_SetGadgetAttrsA (textY, win, NIL,
  1013.                   [GTTX_TEXT,id_ysize,GTTX_BORDER,1,NIL])
  1014.       Gt_SetGadgetAttrsA (textSize, win, NIL,
  1015.                   [GTTX_TEXT,id_framesb,GTTX_BORDER,1,NIL])
  1016.       Gt_SetGadgetAttrsA (textFrames, win, NIL,
  1017.                   [GTTX_TEXT,id_framess,GTTX_BORDER,1,NIL])
  1018.       Gt_SetGadgetAttrsA (textComp, win, NIL,
  1019.                   [GTTX_TEXT,id_compress,GTTX_BORDER,1,NIL])
  1020.       Gt_SetGadgetAttrsA (textKB,win ,NIL,
  1021.                   [GTTX_TEXT,id_kb,GTTX_BORDER,1,NIL])
  1022.       Gt_SetGadgetAttrsA (textKlata,win ,NIL,
  1023.                   [GTTX_TEXT,id_frames,GTTX_BORDER,1,NIL])
  1024.  ENDIF
  1025. ENDPROC
  1026.  
  1027. PROC ikona()
  1028.         DEF wb:PTR TO wbstartup,wba:PTR TO wbarg,dobj:PTR TO diskobject,toolarray,
  1029.         str,olddir=0,pri=0,read=0
  1030.         IF (iconbase:=OpenLibrary('icon.library',37))
  1031.         ELSE
  1032.             Raise(NO_ICONLIB)
  1033.         ENDIF
  1034.    IF wbmessage
  1035.                 wb:=wbmessage ; wba:=wb.arglist
  1036.                 IF (wba.lock>0) AND (wba.name>0)
  1037.                         olddir:=CurrentDir(wba.lock)
  1038.                 ENDIF
  1039.                  IF (dobj:=GetDiskObject(wba.name))>0
  1040.                     toolarray:=dobj.tooltypes
  1041.                        IF (str:=FindToolType(toolarray,'MP_PATH'))>0
  1042.                          StrCopy(mppath,str,ALL)
  1043.                        ENDIF
  1044.                        IF (str:=FindToolType(toolarray,'AP_PATH'))>0
  1045.                          StrCopy(appath,str,ALL)
  1046.                          IF FileLength(appath)<=0
  1047.                              noap:=1
  1048.                          EasyRequestArgs(NIL,
  1049.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  1050.                         '   I can''t find Amipeg program   \n     check path in icon prefs',
  1051.                         'OK :(']:easystruct,
  1052.                         NIL,NIL)
  1053.                          ENDIF
  1054.                        ENDIF
  1055.                        IF (str:=FindToolType(toolarray,'MP_PRIO'))>0
  1056.                          pri:=Val(str,read)
  1057.                           IF read=0
  1058.                            prio:=pri
  1059.                           ENDIF
  1060.                        ENDIF
  1061.                        IF (str:=FindToolType(toolarray,'SM_PATH'))>0
  1062.                          StrCopy(smpath,str,ALL)
  1063.                        ENDIF
  1064.                        IF (str:=FindToolType(toolarray,'SM_FORM'))>0
  1065.                          StrCopy(smform,str,ALL)
  1066.                        ENDIF
  1067.                        IF (str:=FindToolType(toolarray,'SM_SAMPLEPATH'))>0
  1068.                          StrCopy(dirs,str,ALL)
  1069.                        ENDIF
  1070.                        IF (str:=FindToolType(toolarray,'SM_SAMPLENAME'))>0
  1071.                         IF StrCmp(req.dir[StrLen(dir)-1],':')
  1072.                          StrCopy(gatsampl,dirs)
  1073.                          StrAdd(gatsampl,str)
  1074.                         ELSEIF StrCmp(req.dir[StrLen(dir)-1],'/')
  1075.                          StrCopy(gatsampl,dirs)
  1076.                          StrAdd(gatsampl,str)
  1077.                         ELSEIF StrLen(dirs)<1
  1078.                          StrCopy(gatsampl,dirs)
  1079.                          StrAdd(gatsampl,str)
  1080.                         ELSE
  1081.                          StrCopy(gatsampl,dirs)
  1082.                          StrAdd(gatsampl,'/')
  1083.                          StrAdd(gatsampl,str)
  1084.                         ENDIF
  1085.                        ENDIF
  1086.  
  1087.                        IF (str:=FindToolType(toolarray,'MP_ANIMPATH'))>0
  1088.                          StrCopy(dir,str,ALL)
  1089.                        ENDIF
  1090.                        IF (str:=FindToolType(toolarray,'MP_ANIMNAME'))>0
  1091.                         IF StrCmp(req.dir[StrLen(dir)-1],':')
  1092.                          StrCopy(gattext,dir)
  1093.                          StrAdd(gattext,str)
  1094.                         ELSEIF StrCmp(req.dir[StrLen(dir)-1],'/')
  1095.                          StrCopy(gattext,dir)
  1096.                          StrAdd(gattext,str)
  1097.                         ELSEIF StrLen(dir)<1
  1098.                          StrCopy(gattext,dir)
  1099.                          StrAdd(gattext,str)
  1100.                         ELSE
  1101.                          StrCopy(gattext,dir)
  1102.                          StrAdd(gattext,'/')
  1103.                          StrAdd(gattext,str)
  1104.                         ENDIF
  1105.                        ENDIF
  1106.                        IF (str:=FindToolType(toolarray,'MP_DITHER'))>0
  1107.                          IF StrCmp(UpperStr(str),'GRAY8')
  1108.                              prr:=0
  1109.                          ELSEIF StrCmp(UpperStr(str),'GRAY')
  1110.                              prr:=1
  1111.                          ELSEIF StrCmp(UpperStr(str),'HAM8')
  1112.                              prr:=2
  1113.                          ELSEIF StrCmp(UpperStr(str),'HAM6')
  1114.                              prr:=3
  1115.                          ELSEIF StrCmp(UpperStr(str),'COLOR')
  1116.                              prr:=4
  1117.                          ELSEIF StrCmp(UpperStr(str),'2X2')
  1118.                              prr:=5
  1119.                          ELSEIF StrCmp(UpperStr(str),'MBORDERED')
  1120.                              prr:=6
  1121.                          ELSEIF StrCmp(UpperStr(str),'TRESHOLD')
  1122.                              prr:=7
  1123.                          ELSEIF StrCmp(UpperStr(str),'HYBRID')
  1124.                              prr:=8
  1125.                          ELSEIF StrCmp(UpperStr(str),'HYBRID2')
  1126.                              prr:=9
  1127.                          ELSEIF StrCmp(UpperStr(str),'ORDERED')
  1128.                              prr:=10
  1129.                          ELSEIF StrCmp(UpperStr(str),'ORDERED2')
  1130.                              prr:=11
  1131.                          ELSEIF StrCmp(UpperStr(str),'FS2')
  1132.                              prr:=12
  1133.                          ELSEIF StrCmp(UpperStr(str),'FS2FAST')
  1134.                              prr:=13
  1135.                          ELSEIF StrCmp(UpperStr(str),'FS4')
  1136.                              prr:=14
  1137.                          ELSEIF StrCmp(UpperStr(str),'MONO')
  1138.                              prr:=15
  1139.                          ELSEIF StrCmp(UpperStr(str),'RETINA24')
  1140.                              prr:=16
  1141.                          ELSEIF StrCmp(UpperStr(str),'EGS24')
  1142.                              prr:=17
  1143.                          ELSEIF StrCmp(UpperStr(str),'VILLAGE24')
  1144.                              prr:=18
  1145.                          ELSEIF StrCmp(UpperStr(str),'OPAL24')
  1146.                              prr:=19
  1147.                          ELSEIF StrCmp(UpperStr(str),'OPAL15')
  1148.                              prr:=20
  1149.                          ELSEIF StrCmp(UpperStr(str),'AMP-COLOR')
  1150.                              prr:=21
  1151.                          ELSEIF StrCmp(UpperStr(str),'AMP-HAM6')
  1152.                              prr:=22
  1153.                          ELSEIF StrCmp(UpperStr(str),'AMP-HIRESHAM')
  1154.                              prr:=23
  1155.                          ELSEIF StrCmp(UpperStr(str),'AMP-GRAY')
  1156.                              prr:=23
  1157.                          ELSEIF StrCmp(UpperStr(str),'AMP-CYBERGFX')
  1158.                              prr:=23
  1159.                          ELSEIF StrCmp(UpperStr(str),'AMP-CYBERGFXGRAY')
  1160.                              prr:=23
  1161.                          ELSE
  1162.                              EasyRequestArgs(NIL,
  1163.                             [SIZEOF easystruct, 0, 'Request Window Name',
  1164.                             '   Unknow dither type\nspecified in icon tooltype',
  1165.                             'OK I''ll use DEFAULT (gray8)']:easystruct,
  1166.                             NIL,NIL)
  1167.                          ENDIF
  1168.                        ENDIF
  1169.                        IF (str:=FindToolType(toolarray,'X_WIN'))>0
  1170.                          pri:=Val(str,read)
  1171.                           IF read=0
  1172.                            x:=pri
  1173.                           ENDIF
  1174.                        ENDIF
  1175.                        IF (str:=FindToolType(toolarray,'Y_WIN'))>0
  1176.                          pri:=Val(str,read)
  1177.                           IF read=0
  1178.                            y:=pri
  1179.                           ENDIF
  1180.                        ENDIF
  1181.                        IF (str:=FindToolType(toolarray,'MP_RAM'))>0
  1182.                          IF StrCmp(UpperStr(str),'YES') THEN ch1:=0
  1183.                        ENDIF
  1184.                        IF (str:=FindToolType(toolarray,'MP_NOP'))>0
  1185.                          IF StrCmp(UpperStr(str),'YES') THEN ch4:=0
  1186.                        ENDIF
  1187.                        IF (str:=FindToolType(toolarray,'MP_NOB'))>0
  1188.                          IF StrCmp(UpperStr(str),'YES') THEN ch3:=0
  1189.                        ENDIF
  1190.                        IF (str:=FindToolType(toolarray,'MP_LOOP'))>0
  1191.                          IF StrCmp(UpperStr(str),'YES') THEN ch2:=0
  1192.                        ENDIF
  1193.                        IF (str:=FindToolType(toolarray,'TOPAZ'))>0
  1194.                          IF StrCmp(UpperStr(str),'YES') THEN font:=0
  1195.                        ENDIF
  1196.               CloseLibrary(iconbase)
  1197.           ENDIF
  1198.    ELSE
  1199.        Raise(NO_ICON)
  1200.    ENDIF
  1201. ENDPROC
  1202.  
  1203. PROC cop(nam1,nam2)
  1204.   DEF buffer,leng,actleng,plik,plik2
  1205.   leng:=10240
  1206.   buffer:= AllocMem(leng,0)
  1207.    IF plik :=Open(nam1,OLDFILE)
  1208.    ELSE
  1209.    ENDIF
  1210.    IF plik2 :=Open(nam2,NEWFILE)
  1211.    ELSE
  1212.    ENDIF
  1213.   REPEAT
  1214.    actleng:=Read(plik,buffer,leng)
  1215.    Write(plik2,buffer,actleng)
  1216.   UNTIL actleng<10240
  1217.   Close(plik)
  1218.   Close(plik2)
  1219. ENDPROC
  1220.  
  1221. PROC play()
  1222. DEF roboc[150]:STRING,riek[50]:STRING,po
  1223.   po:=InStr(smform,'{f}')
  1224.   StrCopy(riek,smform,po)
  1225.   StringF(roboc,'run delay -MS \d+\n\s \s"\s"',levelid*5,smpath,riek,stringSamplValue)
  1226.   MidStr(riek,smform,po+3,ALL)
  1227.   StrAdd(roboc,riek)
  1228.   Execute(roboc,0,NIL)
  1229. ENDPROC
  1230.  
  1231.